using FluentNHibernate.Mapping;
using RMH.Entities;

namespace RMH.DataAccess.Mappings
{
    public class StaffRoleMap : ClassMap<StaffRole>
    {
        public StaffRoleMap()
        {
            Id(x => x.Id);
            Map(x => x.Name);
        }
    }
    public class StaffMap : ClassMap<Staff>
    {
        public StaffMap()
        {
            Id(x => x.Id);
            Map(x => x.UserName);
            Map(x => x.Email);
            Map(x => x.Password);
            HasManyToMany(x => x.Roles)
                .Cascade.SaveUpdate();
        }
    }
}